package com.henghong.risk.controller;

import com.henghong.risk.dto.RiskPreventionListDTO;
import com.henghong.risk.result.Result;
import com.henghong.risk.service.RiskPreventionListService;
import com.henghong.risk.vo.RiskPreventionListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/risk")
@Slf4j
@Api(tags = "リスク予防・管理検討会")
public class RiskPreventionListController {

    @Autowired
    private RiskPreventionListService riskPreventionListService;

    @GetMapping("/btnRpiSearchClick")
    @ApiOperation(value = "リスク・予防管理検討会信息取得")
    public Result<List<RiskPreventionListVo>> btnRpiSearchClick(RiskPreventionListDTO riskPreventionListDTO) {
        log.info("リスク・予防管理検討会情報取得");
        List<RiskPreventionListVo> riskPreventionListVoList = riskPreventionListService.btnRpiSearchClick(riskPreventionListDTO);
        return Result.success(riskPreventionListVoList);
    }
}
